package com.luxshare.aos.demo;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.luxshare.aos.R;

public class LayoutInflaterActivity extends Activity {

    @Override
    protected void onCreate(Bundle bundle) {
        Log.i(LayoutInflaterActivity.class.getName(), "onCreate");
        super.onCreate(bundle);
        setContentView(R.layout.activity_layoutinflater);
        LinearLayout parentLayout = (LinearLayout) findViewById(R.id.activity_layoutInflater);

        LayoutInflater layoutInflater = LayoutInflater.from(this);
        //=============1
//        layoutInflater.inflate(R.layout.button_layout, parentLayout);
        //=============2
        View button = layoutInflater.inflate(R.layout.button_layout, null);
        parentLayout.addView(button);
    }
}
